﻿/**
   ActionScript Class File -- Created with SAPIEN Technologies PrimalScript 3.1
   
   @class  
   @package
   @author Colin Leung
   @codehint 
   @example 
   @tooltip 
*/


class com.mixmedia.utils.Conversion {
	static public function hexToColor(argHex,argAlpha){// change hex value to color transform object
		if(argHex == "none"){
			return {ra:100,rb:0,ga:100,gb:0,ba:100,bb:0,aa:100,bb:0};	
		}else{
			var a = (argAlpha == undefined)?100:argAlpha;
			//extract RGB from Hex
			var r = argHex >> 16;
			var g = (argHex ^ (r << 16)) >> 8;
			var b = (argHex ^ (r << 16)) ^ (g << 8);
			return {ra:0,rb:r,ga:0,gb:g,ba:0,bb:b,aa:a,bb:100};
		}
	};
}
